package com.kaikeba.t31.ticket.controller;

import com.kaikeba.t31.core.controller.BaseController;
import com.kaikeba.t31.ticket.po.TrainNumber;
import com.kaikeba.t31.ticket.service.ITrainNumberService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 车次控制器
 *
 * @author Cui Yicheng
 * @since 2021/11/18
 */
@RestController
@RequestMapping("/number")
public class TrainNumberController extends BaseController<ITrainNumberService, TrainNumber> {

    @ApiOperation(value = "始发站", notes = "模糊查询")
    @PostMapping("/start-stations")
    public List<String> startStations(@RequestParam String startStation) {
        return service.listStartStations(startStation);
    }

    @ApiOperation(value = "终点站", notes = "模糊查询")
    @PostMapping("/end-stations")
    public List<String> endStations(@RequestParam String endStation) {
        return service.listStartStations(endStation);
    }

}
